package appapi.service.impl;

import appapi.Request.ApiReq.EquipApiReq;
import appapi.entity.Zhongjiao.ElevatorDataEntity;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import appapi.dao.GantryCraneLiveMapper;
import appapi.entity.Zhongjiao.GantryCraneLiveEntity;
import appapi.service.GantryCraneLiveService;

import java.util.List;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:
 * @date: 2023-08-10 15:56
 */

@Service
public class GantryCraneLiveServiceImpl implements GantryCraneLiveService{

    @Resource
    private GantryCraneLiveMapper gantryCraneLiveMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return gantryCraneLiveMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(GantryCraneLiveEntity record) {
        return gantryCraneLiveMapper.insert(record);
    }

    @Override
    public int insertSelective(GantryCraneLiveEntity record) {
        return gantryCraneLiveMapper.insertSelective(record);
    }

    @Override
    public GantryCraneLiveEntity selectByPrimaryKey(Long id) {
        return gantryCraneLiveMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(GantryCraneLiveEntity record) {
        return gantryCraneLiveMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(GantryCraneLiveEntity record) {
        return gantryCraneLiveMapper.updateByPrimaryKey(record);
    }

     @Override
     public PageInfo<GantryCraneLiveEntity> selectPage(EquipApiReq req) {
         PageHelper.startPage(req.getCurrentPage(),req.getPageSize());
         List<GantryCraneLiveEntity> list = gantryCraneLiveMapper.selectall(req);
         return new PageInfo<>(list,req.getPageSize());
     }
 }
